| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | import { expect } from 'chai'; |
||
| 5 | describe('Custom environment', () => { |
||
| 6 | it('should refuse malformed URL', () => { |
||
| 7 | const stream = createCustomStream({ RUNG_API: 'foo' }, ['publish']); |
||
| 8 | const next = (text = '') => stream.write(`${text}\r`) |
||
| 9 | .then(() => stream.once('data')); |
||
| 10 | |||
| 11 | return stream.once('data') |
||
| 12 | .then(output => { |
||
| 13 | expect(output).to.match(/Warning: invalid API for Rung: "foo"/); |
||
| 14 | return stream.once('data'); |
||
| 15 | }) |
||
| 16 | .then(output => { |
||
| 17 | expect(output).to.match(/Rung email/); |
||
| 18 | return next('[email protected]'); |
||
| 19 | }) |
||
| 20 | .then(output => { |
||
| 21 | expect(output).to.match(/Rung password/); |
||
| 22 | return next('my_super_secure_password_rsrs'); |
||
| 23 | }) |
||
| 24 | .then(output => { |
||
| 25 | console.log(output); |
||
| 26 | return stream.once('data'); |
||
| 27 | }) |
||
| 28 | .finally(stream.close); |
||
| 29 | }).timeout(15000); |
||
| 30 | }); |
||
| 31 | }); |